﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using jiaju.Models;
using jiaju.Models.DBModel;
namespace jiaju.Models.DAL
{
    public class HomeInfoService
    {
        //获取公司信息
        public static HomeInfo getHomeInfo()
        {
            string sql = "select JieShao,ZsTel,LxTel,Email,Address,Info,WenHua,X,Y from dbo.HomeInfo";
            HomeInfo homeInfo = null;
            SqlDataReader sdr = DBHelp.ExecuteReader(sql);
            while (sdr.Read())
            {
                string JieShao = (string)sdr["JieShao"];
                string ZsTel = (string)sdr["ZsTel"];
                string LxTel = (string)sdr["LxTel"];
                string Email = (string)sdr["Email"];
                string Address = (string)sdr["Address"];
                string Info = (string)sdr["Info"];
                string WenHua = (string)sdr["WenHua"];
                string X = (string)sdr["X"];
                string Y = (string)sdr["Y"];
                homeInfo = new HomeInfo()
                {
                    JieShao = JieShao,
                    ZsTel = ZsTel,
                    LxTel = LxTel,
                    Email= Email,
                    Address= Address,
                    Info= Info,
                    WenHua= WenHua,
                    X= X,
                    Y= Y
                };
            }
            return homeInfo;
        }
    }
}